/*
 *  Term.java
 *
 *  Copyright (c) 2006, Telematica Instituut.
 *
 *  This class is based on gate.creole.gazetteer.Lookup
 *
 *  Christian Wartena, 21/12/2006
 *
 */

package telin;
import java.util.List;

/**
*
* @author Telematica Instituut, Christian Wartena
*/


public class Term implements java.io.Serializable {
	public static final int STANDARD = 0;
	public static final int LITERAL = 1;
  /**
   * Creates a new Term value with the given major and minor types 
   *
   * @param oClass ontology class
   * @param oIdentifier identifier of the ontology node
   * @param ontology ontology
   * @param type literal or standard
   */
  public Term(String oClass, String oIdentifier, String ontology, int type){

	  this.oClass = oClass;
	  this.oIdentifier = oIdentifier;
	  this.ontology = ontology;
	  this.type = type;
	  representations = null;
  }

  private List representations;
  
  public String oIdentifier;

  public String oClass;

  /**  the ontology ID */
  public String ontology;
  
  public int type;
  

  /**
   * Returns a string representation of this term
   */
  public String toString(){
    StringBuffer b = new StringBuffer();

    b.append(ontology);
    b.append(":");
    b.append(oClass);
    if (null!= oIdentifier) {
      b.append(".");
      b.append(oIdentifier);
    } 
    return b.toString();
  }

  /**
     * @param obj
   */
  public boolean equals(Object obj){
    if(obj instanceof Term) {
    	Term t = (Term) obj;
    	return (ontology.equals(t.ontology) 
    			&& oClass.equals(t.oClass)
    			&& oIdentifier.equals(t.oIdentifier)
    			&& type == t.type);
    } else { 
    	return false;
    }
  } // equals

public List getRepresentations() {
	return representations;
}

public void setRepresentations(List representations) {
	this.representations = representations;
}
  
  
} // Term

